<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 输入一个正整数N, 输出一个字符串,形式如’1+2-3*4/5+6-7*8/9…N’
        // 例如 N=14 时输出字符串:’1+2-3*4/5+6-7*8/9+10-11*12/13+14’
        var num = Number(prompt("输入一个正整数"));
        var str = "";
        for (var i = 1; i <= num; i++) {
            if(i % 4 == 1) {
                str = str + i + "+";
            }
            if(i % 4 == 2) {
                str = str + i + "-";
            }
            if(i % 4 == 3) {
                str = str + i + "*";
            }
            if(i % 4 == 0) {
                str = str + i + "/";
            }
        }
        
        alert(str);
    </script>
</body>
</html>